import axios from '@/libs/api.request'

export const orderList = (page, pageSize) => {
  const params = {
    'Page': page,
    'PageSize': pageSize
  }
  return axios.request({
    url: 'work_order/',
    params,
    method: 'get'
  })
}

export const orderCreate = (data) => {
  return axios.request({
    url: 'work_order/',
    data,
    method: 'post'
  })
}

export const orderDelete = (id) => {
  return axios.request({
    url: `work_order/${id}/`,
    method: 'delete'
  })
}

export const orderUpdate = (id, data) => {
  return axios.request({
    url: `work_order/${id}/`,
    data,
    method: 'patch'
  })
}
